package app

import (
	"appService/src/application/api"
	"appService/src/application/app/appModels"
	"appService/src/application/app/authGroup"
	"appService/src/application/app/controller"
	"appService/src/authValid/dataAuth"
	"appService/src/global/router"
)

// 返回路由切片
func GetRouterList() []*router.Router {
	return routeMap
}

// 返回数据库表 模型 切片
func GetModeBans() []interface{} {
	return []interface{}{
		new(appModels.Account),
		new(appModels.Users),
		new(appModels.Dictionary),
	}
}

//路由数组
var routeMap []*router.Router = []*router.Router{
	{
		Title:       "公共—获取文件",
		AuthGroupId: authGroup.SHARE_ID,
		Router:      api.ModelRootRouteName + "/file/:file_sign",
		Method:      router.GET,
		Visit:       dataAuth.PUBLIC,
		Object:      &controller.Public{},
		Func:        "File",
	},
	{
		Title:       "公共—下载文件",
		AuthGroupId: authGroup.SHARE_ID,
		Router:      api.ModelRootRouteName + "/download/:file_sign",
		Method:      router.GET,
		Visit:       dataAuth.PUBLIC,
		Object:      &controller.Public{},
		Func:        "FileDownLoad",
	},
	{
		Title:       "字典—添加",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      api.ModelRootRouteName + "/dictionary",
		Method:      router.POST,
		Visit:       dataAuth.AUTH,
		Object:      &controller.Dictionary{},
		Func:        "Add",
	},
	{
		Title:       "字典—删除",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      api.ModelRootRouteName + "/dictionary",
		Method:      router.DELETE,
		Visit:       dataAuth.AUTH,
		Object:      &controller.Dictionary{},
		Func:        "Delete",
	},
	{
		Title:       "字典—修改",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      api.ModelRootRouteName + "/dictionary",
		Method:      router.PUT,
		Visit:       dataAuth.AUTH,
		Object:      &controller.Dictionary{},
		Func:        "Edit",
	},
	{
		Title:       "字典—查询",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      api.ModelRootRouteName + "/dictionary/:key",
		Method:      router.GET,
		Visit:       dataAuth.PUBLIC,
		Object:      &controller.Dictionary{},
		Func:        "Get",
	},
	{
		Title:       "字典—分页列表",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      api.ModelRootRouteName + "/dictionary/:page_size/:page",
		Method:      router.GET,
		Visit:       dataAuth.AUTH,
		Object:      &controller.Dictionary{},
		Func:        "ListPaginate",
	},
	{
		Title:       "字典—列表",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      api.ModelRootRouteName + "/dictionary",
		Method:      router.GET,
		Visit:       dataAuth.PUBLIC,
		Object:      &controller.Dictionary{},
		Func:        "List",
	},
	{
		Title:       "系统设置—添加",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      api.ModelRootRouteName + "/sys/config",
		Method:      router.POST,
		Visit:       dataAuth.AUTH,
		Object:      &controller.Dictionary{},
		Func:        "AddSys",
	},
	{
		Title:       "系统设置—删除",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      api.ModelRootRouteName + "/sys/config",
		Method:      router.DELETE,
		Visit:       dataAuth.AUTH,
		Object:      &controller.Dictionary{},
		Func:        "DeleteSys",
	},
	{
		Title:       "系统设置—修改",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      api.ModelRootRouteName + "/sys/config",
		Method:      router.PUT,
		Visit:       dataAuth.AUTH,
		Object:      &controller.Dictionary{},
		Func:        "EditSys",
	},
	{
		Title:       "系统设置—查询",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      api.ModelRootRouteName + "/sys/config/:key",
		Method:      router.GET,
		Visit:       dataAuth.AUTH,
		Object:      &controller.Dictionary{},
		Func:        "GetSys",
	},
	{
		Title:       "系统设置—分页列表",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      api.ModelRootRouteName + "/sys/config/:page_size/:page",
		Method:      router.GET,
		Visit:       dataAuth.AUTH,
		Object:      &controller.Dictionary{},
		Func:        "ListPaginateSys",
	},
	{
		Title:       "系统设置—列表",
		AuthGroupId: authGroup.ADMIN_ID,
		Router:      api.ModelRootRouteName + "/sys/config",
		Method:      router.GET,
		Visit:       dataAuth.PUBLIC,
		Object:      &controller.Dictionary{},
		Func:        "ListSys",
	},
}
